/*
	       File: dlgSelectWorkflow.cs
	Create Date: 2007-09-09
	    Version:

	Description:


	 Change log:


*/
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace GuerillaProgrammer.FileProcessor
{
    public partial class dlgSelectWorkflow : Form
    {
        #region Private member fields
        private List<Type> _WorkflowTypes;
        private Type _SelectedWorkflow;
        #endregion

        #region Constructors and cleanup methods
        private dlgSelectWorkflow()
        {
        }
        public dlgSelectWorkflow(List<Type> workflowTypes)
        {
            InitializeComponent();
            _WorkflowTypes = workflowTypes;

            lstWorkflows.DisplayMember = "Name";
            lstWorkflows.DataSource = _WorkflowTypes;
        }
        #endregion

        #region Private implementation methods
        #endregion

        #region Class properties
        public List<Type> WorkflowTypes
        {
            get { return _WorkflowTypes; }
            set { _WorkflowTypes = value; }
        }
        public Type SelectedWorkflow
        {
            get { return _SelectedWorkflow; }
            set { _SelectedWorkflow = value; }
        }
        #endregion

        #region Events handlers
        private void btnCancel_Click(object sender, EventArgs e)
        {
            DialogResult = DialogResult.Cancel;
            this.Close();
        }
        private void btnOK_Click(object sender, EventArgs e)
        {
            DialogResult = DialogResult.OK;
            _SelectedWorkflow = (Type)lstWorkflows.SelectedItem;
            this.Close();
        }
        #endregion

    }
}